#ifndef _PIN_H
#define _PIN_H

#include <avr/io.h>
#include "stddef.h"

#define PA 1
#define PB 2
#define PC 3
#define PD 4

#define byte unsigned char

class pin
{
public:
	pin(void);
	void setup(byte, byte, pinDirection);

	void pinOn(void);
	void pinOff(void);

	void set(state);
	void set(void);

	void setInvert(state);

	void clear(void);
	state get(void);

	//Defined as INPUT or OUTPUT
	void setDir(pinDirection);
	pinDirection getDir(void);

	void setBit(byte);
	byte getBit(void);

private:
	state read(void);
	state nRead(void);

	pinDirection _pinDir;
	state _invert;

	byte _port;
	byte _bit;
	byte _mask;
};

#endif
